package com.sinitek.web.response;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @program: elastic
 * @description: Api响应
 * @author: Mr.chen
 * @create: 2019-04-24 12:53
 */
@Data
@NoArgsConstructor
public class ApiResult<T> {
    @ApiModelProperty(value = "状态码")
    private int code;
    @ApiModelProperty(value = "消息结果")
    private String msg;
    @ApiModelProperty(value = "数据")
    private T data;

    public ApiResult(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public ApiResult(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}
